<?php 
require_once 'include.php';
$act=$_REQUEST['act'];
if($act==="reg"){
	$mes=reg();
}elseif($act==="login"){
	$mes=login();
}elseif($act==="userOut"){
	userOut();
}elseif($act==="changeData"){
	$mes=changeData();
}elseif($act==="changeFace"){
	$mes=changeFace();
}
elseif($act==="addCart"){
    if($_SESSION['loginFlag']!="") $response=addCart();
    else $response=array(
            'errno'=>-2,
            'errmsg'=>'fail',
            'data'=>false,
        );
}elseif($act==="changeNum"){
    $response=changeNum();
}elseif($act==="clearCart"){
    $response=clearCart();
}elseif($act==="deleteProduct"){
    $response=deleteProduct();
}elseif($act==="addNewAddress"){
    $mes=addNewAddress();
}elseif($act==="changeAddress"){
    $mes=changeAddress();
}elseif($act==="deleteAddress"){
    $response=deleteAddress();
}elseif($act==="changePassword"){
    $response=changePassword();
}elseif($act==="confirmReceipt"){
    $response=confirmReceipt();
}




    if($response){
        echo json_encode($response);
    }
	if($mes){
		echo $mes;
	}
	
?>